<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <script src="../resources/common.js"></script>
    <title></title>
</head>
<body>
    <p>
        Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=11916">http://bugs.webkit.org/show_bug.cgi?id=11916</a>
        REGRESSION (SearchField): RTL search fields are mixed up</i>.
    </p>
    <p>
        <input type="search" dir="rtl" value="הוא זה A והיא זה B וזהו">
        <br>
        <input type="search" dir="rtl" size="30" value="הוא זה A והיא זה B וזהו">
        <br>
        <input id="target" type="search" dir="rtl" value="click the (x) button">
    </p>
    <p id="result">
        Clicking the (x) button should clear the field.
    </p>
    <script>
        if (window.eventSender) {
            var target = $("target");
            var pos = rtlSearchCancelButtonPosition(target);
            eventSender.mouseMoveTo(pos.x, pos.y);
            eventSender.mouseDown();
            eventSender.mouseUp();
            var result = $("result");
            if (target.value == "")
                result.innerText = "PASS";
            else
                result.innerText = "FAIL";
        }
    </script>
</body>
</html>
